package DEEPERsource.DEEPERsource.source.treedata.types;

import java.util.HashSet;
import java.util.Set;

public enum PennPOS {
	ROOT, S, SBAR,
	ADJP, ADVP, CONJP, NP, PP, PRN, PRT, QP, VP, WHADJP, WHADVP, WHNP, WHPP, X, LST, UCP, NPTMP,
	CC, CD, DT, EX, FW, IN, JJ, JJR, JJS, LS, MD, NN, NNS, NNP, NNPS, PDT, POS, PRP, PRP$, RBR, RB, RBS, RP, SYM, TO, UH, VB, VBD, VBG, VBN, VBP, VBZ, WDT, WP, WP$, WRB,
	COMMA, FULLSTOP, COLON, RRB, LRB, RCB, LCB, OPENQUOTE, CLOSEQUOTE,
	FRAG, $, SINV, NX, INTJ, RRC;
	//NPprotein, NNprotein, NNPprotein, CDprotein, NNSprotein, JJprotein;
	
	public static PennPOS getPOS(String POS) throws IllegalArgumentException {
		if(POS.equals(",")){
			return COMMA;
		}else if(POS.equals(".")){
			return FULLSTOP;
		}else if(POS.equals(":")){
			return COLON;
		}else if(POS.equals("-LRB-")){
			return LRB;
		}else if(POS.equals("-RRB-")){
			return RRB;
		}else if(POS.equals("-LCB-")){
			return LCB;
		}else if(POS.equals("-RCB-")){
			return RCB;
		}else if(POS.equals("NP-TMP")){
			return NPTMP;
		}else if(POS.equals("``")){
			return OPENQUOTE;
		}else if(POS.equals("''")){
			return CLOSEQUOTE;
		}else{ 
			return PennPOS.valueOf(POS);
		}		
	}
	
	public static PennPOS[] verbs(){
		return new PennPOS[]{VB, VBD, VBG, VBN, VBP, VBZ}; 
	}

	//equals cannot be overloaded, so use this equals instead 
	/*public boolean isEquals(Object o) {
		if (o == this) {
			return true;
		} else if (!(o instanceof PennPOS)) {
			return false;
		}
		Set<PennPOS> equalPOS = new HashSet<PennPOS>();
		equalPOS.add(NPprotein);	equalPOS.add(NP);
		equalPOS.add(NNprotein);	equalPOS.add(NN);
		equalPOS.add(NNPprotein);	equalPOS.add(NNP);
		equalPOS.add(CDprotein);	equalPOS.add(NNSprotein);
		equalPOS.add(JJprotein);
		
		if(equalPOS.contains(((PennPOS)o))&&equalPOS.contains(this)){
			return true;
		}else if(((PennPOS)o).equals(this)){
			return true;
		}
		return false;
	}*/
}
